import 'package:hotpot/generated/json/base/json_convert_content.dart';
import 'package:hotpot/models/shop_detail.dart';
import 'package:hotpot/models/floor.dart';


ShopDetail $ShopDetailFromJson(Map<String, dynamic> json) {
	final ShopDetail shopDetail = ShopDetail();
	final ShopDetailPosSession? posSession = jsonConvert.convert<ShopDetailPosSession>(json['pos_session']);
	if (posSession != null) {
		shopDetail.posSession = posSession;
	}
	final Map<String, dynamic>? attributes = jsonConvert.convert<Map<String, dynamic>>(json['attributes']);
	if (attributes != null) {
		shopDetail.attributes = attributes;
	}
	final bool? modulePosHr = jsonConvert.convert<bool>(json['module_pos_hr']);
	if (modulePosHr != null) {
		shopDetail.modulePosHr = modulePosHr;
	}
	final List<ShopDetailHrEmployees>? hrEmployees = jsonConvert.convertListNotNull<ShopDetailHrEmployees>(json['hr_employees']);
	if (hrEmployees != null) {
		shopDetail.hrEmployees = hrEmployees;
	}
	final List<ShopDetailVegetableSequences>? vegetableSequences = jsonConvert.convertListNotNull<ShopDetailVegetableSequences>(json['vegetable_sequences']);
	if (vegetableSequences != null) {
		shopDetail.vegetableSequences = vegetableSequences;
	}
	final List<Floor>? restaurantFloors = jsonConvert.convertListNotNull<Floor>(json['restaurant_floors']);
	if (restaurantFloors != null) {
		shopDetail.restaurantFloors = restaurantFloors;
	}
	final List<ShopDetailPosCategorys>? posCategorys = jsonConvert.convertListNotNull<ShopDetailPosCategorys>(json['pos_categorys']);
	if (posCategorys != null) {
		shopDetail.posCategorys = posCategorys;
	}
	final List<ShopDetailProductProducts>? productProducts = jsonConvert.convertListNotNull<ShopDetailProductProducts>(json['product_products']);
	if (productProducts != null) {
		shopDetail.productProducts = productProducts;
	}
	final List<PosCombo>? posCombo = jsonConvert.convertListNotNull<PosCombo>(json['pos_combo']);
	if (posCombo != null) {
		shopDetail.posCombo = posCombo;
	}
	final List<PosComboLine>? posComboLine = jsonConvert.convertListNotNull<PosComboLine>(json['pos_combo_line']);
	if (posComboLine != null) {
		shopDetail.posComboLine = posComboLine;
	}
	final List<String>? homeImages = jsonConvert.convertListNotNull<String>(json['home_images']);
	if (homeImages != null) {
		shopDetail.homeImages = homeImages;
	}
	return shopDetail;
}

Map<String, dynamic> $ShopDetailToJson(ShopDetail entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['pos_session'] = entity.posSession?.toJson();
	data['attributes'] = entity.attributes;
	data['module_pos_hr'] = entity.modulePosHr;
	data['hr_employees'] =  entity.hrEmployees?.map((v) => v.toJson()).toList();
	data['vegetable_sequences'] =  entity.vegetableSequences?.map((v) => v.toJson()).toList();
	data['restaurant_floors'] =  entity.restaurantFloors?.map((v) => v.toJson()).toList();
	data['pos_categorys'] =  entity.posCategorys?.map((v) => v.toJson()).toList();
	data['product_products'] =  entity.productProducts?.map((v) => v.toJson()).toList();
	data['pos_combo'] =  entity.posCombo?.map((v) => v.toJson()).toList();
	data['pos_combo_line'] =  entity.posComboLine?.map((v) => v.toJson()).toList();
	data['home_images'] =  entity.homeImages;
	return data;
}

ShopDetailPosSession $ShopDetailPosSessionFromJson(Map<String, dynamic> json) {
	final ShopDetailPosSession shopDetailPosSession = ShopDetailPosSession();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailPosSession.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailPosSession.name = name;
	}
	final List<int>? userId = jsonConvert.convertListNotNull<int>(json['user_id']);
	if (userId != null) {
		shopDetailPosSession.userId = userId;
	}
	final List<String>? configId = jsonConvert.convertListNotNull<String>(json['config_id']);
	if (configId != null) {
		shopDetailPosSession.configId = configId;
	}
	final String? startAt = jsonConvert.convert<String>(json['start_at']);
	if (startAt != null) {
		shopDetailPosSession.startAt = startAt;
	}
	final bool? stopAt = jsonConvert.convert<bool>(json['stop_at']);
	if (stopAt != null) {
		shopDetailPosSession.stopAt = stopAt;
	}
	final int? sequenceNumber = jsonConvert.convert<int>(json['sequence_number']);
	if (sequenceNumber != null) {
		shopDetailPosSession.sequenceNumber = sequenceNumber;
	}
	final List<int>? paymentMethodIds = jsonConvert.convertListNotNull<int>(json['payment_method_ids']);
	if (paymentMethodIds != null) {
		shopDetailPosSession.paymentMethodIds = paymentMethodIds;
	}
	final String? state = jsonConvert.convert<String>(json['state']);
	if (state != null) {
		shopDetailPosSession.state = state;
	}
	final bool? updateStockAtClosing = jsonConvert.convert<bool>(json['update_stock_at_closing']);
	if (updateStockAtClosing != null) {
		shopDetailPosSession.updateStockAtClosing = updateStockAtClosing;
	}
	final int? cashRegisterBalanceStart = jsonConvert.convert<int>(json['cash_register_balance_start']);
	if (cashRegisterBalanceStart != null) {
		shopDetailPosSession.cashRegisterBalanceStart = cashRegisterBalanceStart;
	}
	final String? accessToken = jsonConvert.convert<String>(json['access_token']);
	if (accessToken != null) {
		shopDetailPosSession.accessToken = accessToken;
	}
	final int? loginNumber = jsonConvert.convert<int>(json['login_number']);
	if (loginNumber != null) {
		shopDetailPosSession.loginNumber = loginNumber;
	}
	return shopDetailPosSession;
}

Map<String, dynamic> $ShopDetailPosSessionToJson(ShopDetailPosSession entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['user_id'] =  entity.userId;
	data['config_id'] =  entity.configId;
	data['start_at'] = entity.startAt;
	data['stop_at'] = entity.stopAt;
	data['sequence_number'] = entity.sequenceNumber;
	data['payment_method_ids'] =  entity.paymentMethodIds;
	data['state'] = entity.state;
	data['update_stock_at_closing'] = entity.updateStockAtClosing;
	data['cash_register_balance_start'] = entity.cashRegisterBalanceStart;
	data['access_token'] = entity.accessToken;
	data['login_number'] = entity.loginNumber;
	return data;
}

ShopDetailAttributes $ShopDetailAttributesFromJson(Map<String, dynamic> json) {
	final ShopDetailAttributes shopDetailAttributes = ShopDetailAttributes();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailAttributes.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailAttributes.name = name;
	}
	final String? displayType = jsonConvert.convert<String>(json['display_type']);
	if (displayType != null) {
		shopDetailAttributes.displayType = displayType;
	}
	final List<ShopDetailAttributesValues>? values = jsonConvert.convertListNotNull<ShopDetailAttributesValues>(json['values']);
	if (values != null) {
		shopDetailAttributes.values = values;
	}
	final int? sequence = jsonConvert.convert<int>(json['sequence']);
	if (sequence != null) {
		shopDetailAttributes.sequence = sequence;
	}
	final bool? canBeSetQty = jsonConvert.convert<bool>(json['can_be_set_qty']);
	if (canBeSetQty != null) {
		shopDetailAttributes.canBeSetQty = canBeSetQty;
	}
	final int? maxQty = jsonConvert.convert<int>(json['max_qty']);
	if (maxQty != null) {
		shopDetailAttributes.maxQty = maxQty;
	}
	return shopDetailAttributes;
}

Map<String, dynamic> $ShopDetailAttributesToJson(ShopDetailAttributes entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['display_type'] = entity.displayType;
	data['values'] =  entity.values?.map((v) => v.toJson()).toList();
	data['sequence'] = entity.sequence;
	data['can_be_set_qty'] = entity.canBeSetQty;
	data['max_qty'] = entity.maxQty;
	return data;
}

ShopDetailAttributesValues $ShopDetailAttributesValuesFromJson(Map<String, dynamic> json) {
	final ShopDetailAttributesValues shopDetailAttributesValues = ShopDetailAttributesValues();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailAttributesValues.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailAttributesValues.name = name;
	}
	final bool? isCustom = jsonConvert.convert<bool>(json['is_custom']);
	if (isCustom != null) {
		shopDetailAttributesValues.isCustom = isCustom;
	}
	final String? htmlColor = jsonConvert.convert<String>(json['html_color']);
	if (htmlColor != null) {
		shopDetailAttributesValues.htmlColor = htmlColor;
	}
	final String? image = jsonConvert.convert<String>(json['image']);
	if (image != null) {
		shopDetailAttributesValues.image = image;
	}
	final int? maxQty = jsonConvert.convert<int>(json['max_qty']);
	if (maxQty != null) {
		shopDetailAttributesValues.maxQty = maxQty;
	}
	final double? priceExtra = jsonConvert.convert<double>(json['price_extra']);
	if (priceExtra != null) {
		shopDetailAttributesValues.priceExtra = priceExtra;
	}
	return shopDetailAttributesValues;
}

Map<String, dynamic> $ShopDetailAttributesValuesToJson(ShopDetailAttributesValues entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['is_custom'] = entity.isCustom;
	data['html_color'] = entity.htmlColor;
	data['image'] = entity.image;
	data['max_qty'] = entity.maxQty;
	data['price_extra'] = entity.priceExtra;
	return data;
}

ShopDetailHrEmployees $ShopDetailHrEmployeesFromJson(Map<String, dynamic> json) {
	final ShopDetailHrEmployees shopDetailHrEmployees = ShopDetailHrEmployees();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailHrEmployees.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailHrEmployees.name = name;
	}
	final int? userId = jsonConvert.convert<int>(json['user_id']);
	if (userId != null) {
		shopDetailHrEmployees.userId = userId;
	}
	final int? workContactId = jsonConvert.convert<int>(json['work_contact_id']);
	if (workContactId != null) {
		shopDetailHrEmployees.workContactId = workContactId;
	}
	final String? role = jsonConvert.convert<String>(json['role']);
	if (role != null) {
		shopDetailHrEmployees.role = role;
	}
	final bool? barcode = jsonConvert.convert<bool>(json['barcode']);
	if (barcode != null) {
		shopDetailHrEmployees.barcode = barcode;
	}
	final String? pin = jsonConvert.convert<String>(json['pin']);
	if (pin != null) {
		shopDetailHrEmployees.pin = pin;
	}
	return shopDetailHrEmployees;
}

Map<String, dynamic> $ShopDetailHrEmployeesToJson(ShopDetailHrEmployees entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['user_id'] = entity.userId;
	data['work_contact_id'] = entity.workContactId;
	data['role'] = entity.role;
	data['barcode'] = entity.barcode;
	data['pin'] = entity.pin;
	return data;
}

ShopDetailVegetableSequences $ShopDetailVegetableSequencesFromJson(Map<String, dynamic> json) {
	final ShopDetailVegetableSequences shopDetailVegetableSequences = ShopDetailVegetableSequences();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailVegetableSequences.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailVegetableSequences.name = name;
	}
	final int? sequence = jsonConvert.convert<int>(json['sequence']);
	if (sequence != null) {
		shopDetailVegetableSequences.sequence = sequence;
	}
	final int? color = jsonConvert.convert<int>(json['color']);
	if (color != null) {
		shopDetailVegetableSequences.color = color;
	}
	return shopDetailVegetableSequences;
}

Map<String, dynamic> $ShopDetailVegetableSequencesToJson(ShopDetailVegetableSequences entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['sequence'] = entity.sequence;
	data['color'] = entity.color;
	return data;
}

ShopDetailPosCategorys $ShopDetailPosCategorysFromJson(Map<String, dynamic> json) {
	final ShopDetailPosCategorys shopDetailPosCategorys = ShopDetailPosCategorys();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailPosCategorys.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailPosCategorys.name = name;
	}
	final List<String>? parentId = jsonConvert.convertListNotNull<String>(json['parent_id']);
	if (parentId != null) {
		shopDetailPosCategorys.parentId = parentId;
	}
	final List<int>? childId = jsonConvert.convertListNotNull<int>(json['child_id']);
	if (childId != null) {
		shopDetailPosCategorys.childId = childId;
	}
	final String? writeDate = jsonConvert.convert<String>(json['write_date']);
	if (writeDate != null) {
		shopDetailPosCategorys.writeDate = writeDate;
	}
	final bool? hasImage = jsonConvert.convert<bool>(json['has_image']);
	if (hasImage != null) {
		shopDetailPosCategorys.hasImage = hasImage;
	}
	final int? color = jsonConvert.convert<int>(json['color']);
	if (color != null) {
		shopDetailPosCategorys.color = color;
	}
	final bool? required = jsonConvert.convert<bool>(json['required']);
	if (required != null) {
		shopDetailPosCategorys.required = required;
	}
	return shopDetailPosCategorys;
}

Map<String, dynamic> $ShopDetailPosCategorysToJson(ShopDetailPosCategorys entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['parent_id'] =  entity.parentId;
	data['child_id'] =  entity.childId;
	data['write_date'] = entity.writeDate;
	data['has_image'] = entity.hasImage;
	data['color'] = entity.color;
	data['required'] = entity.required;
	return data;
}

ShopDetailProductProducts $ShopDetailProductProductsFromJson(Map<String, dynamic> json) {
	final ShopDetailProductProducts shopDetailProductProducts = ShopDetailProductProducts();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopDetailProductProducts.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopDetailProductProducts.name = name;
	}
	final bool? barcode = jsonConvert.convert<bool>(json['barcode']);
	if (barcode != null) {
		shopDetailProductProducts.barcode = barcode;
	}
	final String? cnName = jsonConvert.convert<String>(json['cn_name']);
	if (cnName != null) {
		shopDetailProductProducts.cnName = cnName;
	}
	final String? defaultCode = jsonConvert.convert<String>(json['default_code']);
	if (defaultCode != null) {
		shopDetailProductProducts.defaultCode = defaultCode;
	}
	final String? publicDescriptionImage = jsonConvert.convert<String>(json['public_description_image']);
	if (publicDescriptionImage != null) {
		shopDetailProductProducts.publicDescriptionImage = publicDescriptionImage;
	}
	final String? publicDescriptionText = jsonConvert.convert<String>(json['public_description_text']);
	if (publicDescriptionText != null) {
		shopDetailProductProducts.publicDescriptionText = publicDescriptionText;
	}
	final List<String>? allergySource = jsonConvert.convertListNotNull<String>(json['allergy_source']);
	if (allergySource != null) {
		shopDetailProductProducts.allergySource = allergySource;
	}
	final String? productTag = jsonConvert.convert<String>(json['product_tag']);
	if (productTag != null) {
		shopDetailProductProducts.productTag = productTag;
	}
	final double? lstPrice = jsonConvert.convert<double>(json['lst_price']);
	if (lstPrice != null) {
		shopDetailProductProducts.lstPrice = lstPrice;
	}
	final bool? needVegetableSequence = jsonConvert.convert<bool>(json['need_vegetable_sequence']);
	if (needVegetableSequence != null) {
		shopDetailProductProducts.needVegetableSequence = needVegetableSequence;
	}
	final bool? canSetAttributesQty = jsonConvert.convert<bool>(json['can_set_attributes_qty']);
	if (canSetAttributesQty != null) {
		shopDetailProductProducts.canSetAttributesQty = canSetAttributesQty;
	}
	final List<int>? attributeLineIds = jsonConvert.convertListNotNull<int>(json['attribute_line_ids']);
	if (attributeLineIds != null) {
		shopDetailProductProducts.attributeLineIds = attributeLineIds;
	}
	final List<int>? posCategIds = jsonConvert.convertListNotNull<int>(json['pos_categ_ids']);
	if (posCategIds != null) {
		shopDetailProductProducts.posCategIds = posCategIds;
	}
	final List<int>? comboIds = jsonConvert.convertListNotNull<int>(json['combo_ids']);
	if (comboIds != null) {
		shopDetailProductProducts.comboIds = comboIds;
	}
	final List<String>? notes = jsonConvert.convertListNotNull<String>(json['notes']);
	if (notes != null) {
		shopDetailProductProducts.notes = notes;
	}
	final String? image = jsonConvert.convert<String>(json['image']);
	if (image != null) {
		shopDetailProductProducts.image = image;
	}
	final List<String>? images = jsonConvert.convertListNotNull<String>(json['images']);
	if (images != null) {
		shopDetailProductProducts.images = images;
	}
	return shopDetailProductProducts;
}

Map<String, dynamic> $ShopDetailProductProductsToJson(ShopDetailProductProducts entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['barcode'] = entity.barcode;
	data['cn_name'] = entity.cnName;
	data['default_code'] = entity.defaultCode;
	data['public_description_image'] = entity.publicDescriptionImage;
	data['public_description_text'] = entity.publicDescriptionText;
	data['allergy_source'] =  entity.allergySource;
	data['product_tag'] = entity.productTag;
	data['lst_price'] = entity.lstPrice;
	data['need_vegetable_sequence'] = entity.needVegetableSequence;
	data['can_set_attributes_qty'] = entity.canSetAttributesQty;
	data['attribute_line_ids'] =  entity.attributeLineIds;
	data['pos_categ_ids'] =  entity.posCategIds;
	data['combo_ids'] =  entity.comboIds;
	data['notes'] =  entity.notes;
	data['image'] = entity.image;
	data['images'] =  entity.images;
	return data;
}

PosCombo $PosComboFromJson(Map<String, dynamic> json) {
	final PosCombo posCombo = PosCombo();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		posCombo.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		posCombo.name = name;
	}
	final List<int>? comboLineIds = jsonConvert.convertListNotNull<int>(json['combo_line_ids']);
	if (comboLineIds != null) {
		posCombo.comboLineIds = comboLineIds;
	}
	final int? basePrice = jsonConvert.convert<int>(json['base_price']);
	if (basePrice != null) {
		posCombo.basePrice = basePrice;
	}
	return posCombo;
}

Map<String, dynamic> $PosComboToJson(PosCombo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['combo_line_ids'] =  entity.comboLineIds;
	data['base_price'] = entity.basePrice;
	return data;
}

PosComboLine $PosComboLineFromJson(Map<String, dynamic> json) {
	final PosComboLine posComboLine = PosComboLine();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		posComboLine.id = id;
	}
	final List<String>? productId = jsonConvert.convertListNotNull<String>(json['product_id']);
	if (productId != null) {
		posComboLine.productId = productId;
	}
	final int? comboPrice = jsonConvert.convert<int>(json['combo_price']);
	if (comboPrice != null) {
		posComboLine.comboPrice = comboPrice;
	}
	final List<String>? comboId = jsonConvert.convertListNotNull<String>(json['combo_id']);
	if (comboId != null) {
		posComboLine.comboId = comboId;
	}
	return posComboLine;
}

Map<String, dynamic> $PosComboLineToJson(PosComboLine entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['product_id'] =  entity.productId;
	data['combo_price'] = entity.comboPrice;
	data['combo_id'] =  entity.comboId;
	return data;
}